import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import pxtovw from 'postcss-px-to-viewport'
 
//配置参数
const usePxtovw = pxtovw({
  viewportWidth: 2560,
  viewportUnit: 'vw'
})
 
export default defineConfig({
  plugins: [react()],
  css: {
    postcss: {
      plugins: [usePxtovw]
    }
  },
  server: {
    proxy: {
      '/api': {
        target: 'http://localhost:9000',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      },
    },
  },
})